<%--
  Created by IntelliJ IDEA.
  User: tjcu
  Date: 2019/12/3
  Time: 17:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript">
        window.onload = function () {
     var pwd1 =  document.getElementById("pwd1");
     var pwd1 =  document.getElementById("pwd1");
     pwd1.onblur = function () {
    var pwd1_value = pwd1.value;
    if (pwd1_value == null ){
        alert("请您填写密码！");
    }
    else {
        if (pwd1_value != ${sessionScope.user.password}){
            alert("您的原始密码有误！");
        }
        else {
            alert("ok");
        }
    }

     }
        }
    </script>
</head>
<body>
<h1>修改密码</h1>
<form action="/updatePassword">
    <input type="hidden" name="id" value="${sessionScope.user.id}">
    <table border="1" cellspacing="0" cellpadding="4">
        <tr>
            <td>原始密码：</td>
            <td><input type="password" id="pwd1" name="oldPassword"><span id="s1"></span></td>
        </tr>   <tr>
            <td>新密码：</td>
            <td><input type="password"  id="pwd2" name="newPassword"><span id="s2"></span></td>
        </tr>
        <tr>
            <td>确认密码：</td>
            <td><input type="password"  id="pwd3" name="pwd3"><span id="s3"></span></td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="修改"></td>
        </tr>
    </table>
</form>
</body>
</html>
